package com.wander.patterns.act.mediator;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:具体的中介人
 * @author: zhuyong
 * @create: 2019-09-09 17:16
 **/
public class ConcreteMediator implements Mediator {
    Map<String,Department> map = new HashMap<>();
    @Override
    public void register(String departName, Department department) {
        map.put(departName,department);
    }

    @Override
    public void command(String departName) {
        //吩咐部门执行
        map.get(departName).selfAction();
    }
}
